package com.shop.service.impl;

import com.shop.bean.Admin;
import com.shop.bean.User;
import com.shop.dao.AdminDao;
import com.shop.service.IAdminService;
import com.shop.util.Page;
import com.shop.util.SYS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements IAdminService {

    @Autowired
    AdminDao adminDao;

    @Override
    public int reloadPassword(Integer id){
        String hexpass= SYS.digest("123456");
        return adminDao.reloadPassword(id,hexpass);
    }

    @Override
    public List<Admin> selectAdmins  (Page page, String text) {
        return adminDao.selectAdmins(page, text);
    }

    @Override
    public int getCount(String text) {
        return adminDao.getCount(text);
    }

    @Override
    public int deleteAdmin(int id) {
        return adminDao.deleteAdmin(id);
    }
}
